package atguigu.cglib.javaProxy;

import java.lang.reflect.Proxy;

public class TestJavaProxy {
	public static void main(String[] args) {
		
		IProduct product = new ProductImpl();
		
		ProductProxy productProxy = new ProductProxy(product);
		
		IProduct product2 = (IProduct) Proxy.newProxyInstance(product.getClass().getClassLoader(), 
				product.getClass().getInterfaces(), productProxy);
		
		Float saleProduct = product2.saleProduct(1000f);
		System.out.println(saleProduct);
		product2.createProduct();
	}
	
}
